package cn.tedu.spring6.service;

import cn.tedu.spring6.dao.UserDao;
import cn.tedu.spring6.dao.VipDao;

public class UserService {
    private UserDao  userDao;
    private VipDao vipDao;

    //set注入的话，必须提供一个set方法
    //Spring 容器会调用set方法，来给UserDao属性赋值


    public void setVipDao(VipDao vipDao) {
        this.vipDao = vipDao;
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    public void saveUser(){
        //保存用户信息到数据库
        userDao.insert();
        vipDao.insert();
    }
}
